home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / tcp_ip / tnos / tnos100s / ctlcheck.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-08  |  717 b   |  41 lines

  1. // make executable with the command:
  2. //        bcc ctlcheck.c
  3.  
  4. #include <stdio.h>
  5. #include <string.h>
  6. #include <dir.h>
  7. #include <dos.h>
  8. #include <io.h>
  9.  
  10. /* a mailbox entry */
  11. struct let {
  12.     long    start;
  13.     long    size;
  14.     long    bid;
  15.     int    status;
  16. };
  17.  
  18.  
  19. void
  20. main (argc, argv)
  21. int argc;
  22. char *argv[];
  23. {
  24. char buf[128];
  25. struct let ff;
  26. FILE *fp;
  27. int k = 1;
  28.  
  29.     sprintf (buf, "/NOS/SPOOL/MAIL/CONTROL/%s.ctl", argv[1]);
  30.     fp = fopen (buf, "rb");
  31.     printf (" #   START      SIZE      BID     STAT\n");
  32.     while (!feof (fp))    {
  33.         fread (&ff, sizeof(struct let), 1, fp);
  34.         if (feof (fp))
  35.             continue;
  36.         printf ("%02d) %08lx  %08lx  %08lx  %04x\n", k, ff.start, ff.size, ff.bid, ff.status);
  37.         k++;
  38.     }
  39. }
  40.  
  41.